import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../views/layout/Layout'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: Layout,
      redirect: 'dashboard',
      children: [{
        path: '/dashboard',
        component: require('@/views/dashboard/index.vue').default,
        name: 'dashboard',
        meta: { title: '总览', icon: 'dashboard', noCache: true }
      }, {
        path: '/device',
        component: require('@/views/device/index.vue').default,
        name: 'device',
        meta: { title: '设备', icon: 'device', noCache: true }
      }, {
        path: '/setting',
        component: require('@/views/setting/index.vue').default,
        name: 'setting',
        meta: { title: '设置', icon: 'setting', noCache: true }
      }, {
        path: '/people',
        component: require('@/views/people/index.vue').default,
        name: 'people',
        meta: { title: '附近的人', icon: 'user', noCache: true }
      }, {
        path: '/chart',
        component: require('@/views/people/index.vue').default,
        name: 'chart',
        meta: { title: '统计', icon: 'user', noCache: true }
      }, {
        path: '/warning',
        component: require('@/views/warning/index.vue').default,
        name: 'warning',
        meta: { title: '预警记录', icon: 'user', noCache: true }
      }, {
        path: '/keyPerson',
        component: require('@/views/keyPerson/index.vue').default,
        name: 'keyPerson',
        meta: { title: '重点监控人', icon: 'user', noCache: true }
      }]
    }, {
      path: '/login',
      component: require('@/views/login/index.vue').default,
      name: 'login',
      meta: { title: 'login', icon: 'login', noCache: true }
    }
  ]
})
